<template>
  <div class="bangongshi-container">
    <Header />
    <div class="management-main">
      <div class="left-nav">
        <router-link 
          to="/buzhang/bangongshi/memberManagement" 
          class="nav-item" 
          :class="{ 'active': $route.path.includes('memberManagement') }"
        >
          成员管理
        </router-link>
        <router-link 
          to="/buzhang/bangongshi/deptIntro" 
          class="nav-item" 
          :class="{ 'active': $route.path.includes('deptIntro') }"
        >
          部门简介管理
        </router-link>
        <router-link 
          to="/buzhang/bangongshi/departmentMeeting" 
          class="nav-item" 
          :class="{ 'active': $route.path.includes('departmentMeeting') }"
        >
          部门会议
        </router-link>
        <router-link 
          to="/buzhang/bangongshi/personalCenter" 
          class="nav-item" 
          :class="{ 'active': $route.path.includes('personalCenter') }"
        >
          个人中心
        </router-link>
      </div>
      
      <div class="content-area">
        <router-view />
      </div>
    </div>
    
    <Footer />
  </div>
</template>

<script setup>
import Header from '@/components/Header.vue'
import Footer from '@/components/Footer.vue'
</script>

<style scoped>
.bangongshi-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f5f7fa;
}

.management-main {
  flex: 1;
  display: flex;
  width: 100%;
  margin: 0;
  padding: 20px;
  gap: 20px;
  min-height: calc(100vh - 140px); /* 减去header和footer的高度 */
}

.left-nav {
  width: 200px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 20px 0;
}

.nav-item {
  display: block;
  padding: 15px 20px;
  color: #333;
  text-decoration: none;
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
  background-color: #e6f7ff;
  border-left-color: #1890ff;
  color: #1890ff;
}

.content-area {
  flex: 1;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  overflow: auto;
}

@media (max-width: 768px) {
  .management-main {
    flex-direction: column;
    padding: 10px;
  }
  
  .left-nav {
    width: 100%;
    display: flex;
    overflow-x: auto;
    padding: 10px;
  }
  
  .nav-item {
    white-space: nowrap;
    margin-right: 10px;
    border-left: none;
    border-bottom: 3px solid transparent;
  }
  
  .nav-item.active {
    border-left-color: transparent;
    border-bottom-color: #1890ff;
  }
}
</style>